home *** CD-ROM | disk | FTP | other *** search
/ Classic Games for OS/2 Warp / Classic Games for OS2 Warp (1995)(IBM).iso / mlgames / makeobj.cmd < prev    next >
OS/2 REXX Batch file  |  1995-07-19  |  7KB  |  191 lines

  1. /* Rebuild gamepak folder & icons */
  2.  
  3. rc = RxFuncAdd( "SysCreateObject", "RexxUtil", "SysCreateObject" )
  4. rc = RxFuncAdd( "SysDriveMap", "RexxUtil", "SysDriveMap" )
  5. rc = RxFuncAdd( "SysDriveInfo", "RexxUtil", "SysDriveInfo" )
  6. rc = RxFuncAdd( "SysFileTree", "RexxUtil", "SysFileTree" )
  7.  
  8. /* Create Magic Canvas Folder */
  9.  
  10. /* Create Icons inside folder */
  11. Class  = "WPProgram"
  12. Loc = "<MLGAMES>"
  13.  
  14. /* App setup strings */
  15. Dir      = "\FUNPAK\MLGAMES"
  16. IconName = "MLGAMES.ICO"
  17. FldrName = "MLGAMES"
  18. Setup    = "ICONFILE=" || IconName || ";STARTUPDIR=" || Dir
  19.  
  20. /* get a list of all local drives */
  21. Map = SysDriveMap( , "LOCAL" )
  22.  
  23. /* search for funpak drive & dir */
  24. Do I=1 to Words(Map)
  25.  
  26.    Drive = Strip( Word(Map, I) )
  27.  
  28.    /* Check if Drive is Accessable */
  29.    If ( (SysDriveInfo(Drive) \= "" ) & ,
  30.         (Strip(Word(SysDriveInfo, 2)) \= "0") ) then Do
  31.  
  32.       /* Check if MicroLearn Gamepak Dir exists */
  33.       rc = SysFileTree( Drive || Dir, "File.", "DO" )
  34.       If (File.0 == 1) then Do
  35.  
  36.           /* Create This App's Folder */
  37.           DestFolder = "<" || FldrName || ">"
  38.  
  39.           Class  = "WPFolder"
  40.           Title  = "The MicroLearn Game Pack"
  41.           Loc    = "<FPFOLDER>"
  42.           Setup  = "OBJECTID=" || DestFolder || ,
  43.                    ";ICONFILE=" || Drive || Dir || "\MLGAME0.ICO" || ,
  44.                    ";ICONNFILE=1," || Drive || Dir || "\MLGAME1.ICO"
  45.           Opts   = "Fail"
  46.           ok = SysCreateObject( Class, Title, Loc, Setup, Opts )
  47.  
  48.           /* Insure parent folder was created:                          */
  49.           /* Might fail because object already exists (more than 1      */
  50.           /* copy installed?)  Add drive letter to Title name and OBJID */
  51.           /* and try to recreate object                                 */
  52.           If (ok == 0) Then Do
  53.              Title = Title || " on " || Drive
  54.              DestFolder = "<" || Drive || FldrName || ">"
  55.              Setup = "OBJECTID=" || DestFolder
  56.              Opts = "Replace"
  57.              ok = SysCreateObject( Class, Title, Loc, Setup, Opts )
  58.              End
  59.  
  60.           /* Add Games to the inside of the folder - the exe's should have */
  61.           /*   their icons assigned already.  */
  62.           If (ok == 1) then Do
  63.  
  64.              /* Add "BlockBoucer" Exe */
  65.              Name   = Drive || Dir || "\BB.EXE"
  66.              Class  = "WPProgram"
  67.              Title  = "BlockBouncer"
  68.              Loc    = DestFolder
  69.              Setup  = ";EXENAME=" || Name || ,
  70.                       ";STARTUPDIR=" || Drive || Dir
  71.              Opts   = "Replace"
  72.              call SysCreateObject Class, Title, Loc, Setup, Opts
  73.  
  74.              /* Add "Combo" Exe: */
  75.              Name   = Drive || Dir || "\COMBO.EXE"
  76.              Class  = "WPProgram"
  77.              Title  = "Combo"
  78.              Loc    = DestFolder
  79.              Setup  = ";EXENAME=" || Name || ,
  80.                       ";STARTUPDIR=" || Drive || Dir
  81.              Opts   = "Replace"
  82.              call SysCreateObject Class, Title, Loc, Setup, Opts
  83.  
  84.              /* Add "Four Fun" Exe: */
  85.              Name   = Drive || Dir || "\FOUR.EXE"
  86.              Class  = "WPProgram"
  87.              Title  = "Four Fun"
  88.              Loc    = DestFolder
  89.              Setup  = ";EXENAME=" || Name || ,
  90.                        ";STARTUPDIR=" || Drive || Dir
  91.              Opts   = "Replace"
  92.              call SysCreateObject Class, Title, Loc, Setup, Opts
  93.  
  94.              /* Add "Go-Moku" Exe: */
  95.              Name   = Drive || Dir || "\GOMOKU.EXE"
  96.              Class  = "WPProgram"
  97.              Title  = "Go-Moku"
  98.              Loc    = DestFolder
  99.              Setup  = ";EXENAME=" || Name || ,
  100.                       ";STARTUPDIR=" || Drive || Dir
  101.              Opts   = "Replace"
  102.              call SysCreateObject Class, Title, Loc, Setup, Opts
  103.  
  104.              /* Add "Manta Ghiis: */
  105.              Name   = Drive || Dir || "\MANTA.EXE"
  106.              Class  = "WPProgram"
  107.              Title  = "Manta Ghiis"
  108.              Loc    = DestFolder
  109.              Setup  = ";EXENAME=" || Name || ,
  110.                       ";STARTUPDIR=" || Drive || Dir
  111.              Opts   = "Replace"
  112.              call SysCreateObject Class, Title, Loc, Setup, Opts
  113.  
  114.              /* Add "Mind Sweeper" */
  115.              Name   = Drive || Dir || "\SWEEPER.EXE"
  116.              Class  = "WPProgram"
  117.              Title  = "MindSweeper"
  118.              Loc    = DestFolder
  119.              Setup  = ";EXENAME=" || Name || ,
  120.                       ";STARTUPDIR=" || Drive || Dir
  121.              Opts   = "Replace"
  122.              call SysCreateObject Class, Title, Loc, Setup, Opts
  123.  
  124.              /* Add "Soko PM" */
  125.              Name   = Drive || Dir || "\SOKOPM.EXE"
  126.              Class  = "WPProgram"
  127.              Title  = "Soko PM"
  128.              Loc    = DestFolder
  129.              Setup  = ";EXENAME=" || Name || ,
  130.                       ";STARTUPDIR=" || Drive || Dir
  131.              Opts   = "Replace"
  132.              call SysCreateObject Class, Title, Loc, Setup, Opts
  133.  
  134.              /* Add "Solitaire" */
  135.              Name   = Drive || Dir || "\SOL.EXE"
  136.              Class  = "WPProgram"
  137.              Title  = "Solitaire"
  138.              Loc    = DestFolder
  139.              Setup  = ";EXENAME=" || Name || ,
  140.                       ";STARTUPDIR=" || Drive || Dir
  141.              Opts   = "Replace"
  142.              call SysCreateObject Class, Title, Loc, Setup, Opts
  143.  
  144.              /* Add "The Wall" */
  145.              Name   = Drive || Dir || "\WALL.EXE"
  146.              Class  = "WPProgram"
  147.              Title  = "The Wall"
  148.              Loc    = DestFolder
  149.              Setup  = ";EXENAME=" || Name || ,
  150.                       ";STARTUPDIR=" || Drive || Dir
  151.              Opts   = "Replace"
  152.              call SysCreateObject Class, Title, Loc, Setup, Opts
  153.  
  154.              /* Add "Wordmaster" */
  155.              Name   = Drive || Dir || "\WM.EXE"
  156.              Class  = "WPProgram"
  157.              Title  = "WordMaster"
  158.              Loc    = DestFolder
  159.              Setup  = ";EXENAME=" || Name || ,
  160.                       ";STARTUPDIR=" || Drive || Dir
  161.              Opts   = "Replace"
  162.              call SysCreateObject Class, Title, Loc, Setup, Opts
  163.  
  164.              /* Add "SokoPM Ed" */
  165.              Name   = Drive || Dir || "\SOKOEDIT.EXE"
  166.              Class  = "WPProgram"
  167.              Title  = "SokoPM Editor"
  168.              Loc    = DestFolder
  169.              Setup  = ";EXENAME=" || Name || ,
  170.                       ";STARTUPDIR=" || Drive || Dir
  171.              Opts   = "Replace"
  172.              call SysCreateObject Class, Title, Loc, Setup, Opts
  173.  
  174.              /* Add "Wall Ed" */
  175.              Name   = Drive || Dir || "\WALLEDIT.EXE"
  176.              Class  = "WPProgram"
  177.              Title  = "The Wall Editor"
  178.              Loc    = DestFolder
  179.              Setup  = ";EXENAME=" || Name || ,
  180.                       ";STARTUPDIR=" || Drive || Dir
  181.              Opts   = "Replace"
  182.              call SysCreateObject Class, Title, Loc, Setup, Opts
  183.  
  184.              End
  185.  
  186.          End
  187.  
  188.       End
  189.  
  190.    End
  191.